{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "3849117e-cc38-413e-b5af-299062b9f34c",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "System:\n",
      "    python: 3.13.3 (main, Apr 29 2025, 00:24:01) [GCC 12.2.0]\n",
      "executable: /usr/local/bin/python3.13\n",
      "   machine: Linux-5.18.17-amd64-desktop-hwe-x86_64-with-glibc2.36\n",
      "\n",
      "Python dependencies:\n",
      "      sklearn: 1.6.1\n",
      "          pip: 25.0.1\n",
      "   setuptools: 80.4.0\n",
      "        numpy: 2.2.5\n",
      "        scipy: 1.15.3\n",
      "       Cython: 3.1.2\n",
      "       pandas: 2.2.3\n",
      "   matplotlib: 3.10.3\n",
      "       joblib: 1.5.0\n",
      "threadpoolctl: 3.6.0\n",
      "\n",
      "Built with OpenMP: True\n",
      "\n",
      "threadpoolctl info:\n",
      "       user_api: blas\n",
      "   internal_api: openblas\n",
      "    num_threads: 12\n",
      "         prefix: libscipy_openblas\n",
      "       filepath: /usr/local/lib/python3.13/site-packages/numpy.libs/libscipy_openblas64_-6bb31eeb.so\n",
      "        version: 0.3.28\n",
      "threading_layer: pthreads\n",
      "   architecture: Haswell\n",
      "\n",
      "       user_api: blas\n",
      "   internal_api: openblas\n",
      "    num_threads: 12\n",
      "         prefix: libscipy_openblas\n",
      "       filepath: /usr/local/lib/python3.13/site-packages/scipy.libs/libscipy_openblas-68440149.so\n",
      "        version: 0.3.28\n",
      "threading_layer: pthreads\n",
      "   architecture: Haswell\n",
      "\n",
      "       user_api: openmp\n",
      "   internal_api: openmp\n",
      "    num_threads: 12\n",
      "         prefix: libgomp\n",
      "       filepath: /usr/local/lib/python3.13/site-packages/scikit_learn.libs/libgomp-a34b3233.so.1.0.0\n",
      "        version: None\n"
     ]
    }
   ],
   "source": [
    "import sklearn\n",
    "\n",
    "sklearn.show_versions()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "16d0c378-908b-449c-8084-28f5753d249e",
   "metadata": {},
   "outputs": [],
   "source": [
    "# [一把 sklearn 走天下 | 统计师的Python日记 第12天](https://mp.weixin.qq.com/s?__biz=MjM5MDEzNDAyNQ==&mid=2650314212&idx=1&sn=0f04627d34f4305e0386fc7562563bff&chksm=be454f828932c694f8ce107249457e0ffba705e6e9531807e86a1f468a3a549001c00bb5389e&scene=21)\n",
    "# 从sklearn的自带datasets中导入load_iris数据集\n",
    "from sklearn.datasets import load_iris"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "c64983bf-b8cb-42dd-b91b-da29fff1b152",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "dict_keys(['data', 'target', 'frame', 'target_names', 'DESCR', 'feature_names', 'filename', 'data_module'])\n"
     ]
    }
   ],
   "source": [
    "iris = load_iris()\n",
    "# 数据结构\n",
    "print(iris.keys())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "7bbefaf6-6c98-41f5-817b-81b4b0f2c88f",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['setosa' 'versicolor' 'virginica']\n"
     ]
    }
   ],
   "source": [
    "print(iris.target_names)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "7d9d5ae8-ddca-4d2d-a998-6491ca29e38a",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      ".. _iris_dataset:\n",
      "\n",
      "Iris plants dataset\n",
      "--------------------\n",
      "\n",
      "**Data Set Characteristics:**\n",
      "\n",
      ":Number of Instances: 150 (50 in each of three classes)\n",
      ":Number of Attributes: 4 numeric, predictive attributes and the class\n",
      ":Attribute Information:\n",
      "    - sepal length in cm\n",
      "    - sepal width in cm\n",
      "    - petal length in cm\n",
      "    - petal width in cm\n",
      "    - class:\n",
      "            - Iris-Setosa\n",
      "            - Iris-Versicolour\n",
      "            - Iris-Virginica\n",
      "\n",
      ":Summary Statistics:\n",
      "\n",
      "============== ==== ==== ======= ===== ====================\n",
      "                Min  Max   Mean    SD   Class Correlation\n",
      "============== ==== ==== ======= ===== ====================\n",
      "sepal length:   4.3  7.9   5.84   0.83    0.7826\n",
      "sepal width:    2.0  4.4   3.05   0.43   -0.4194\n",
      "petal length:   1.0  6.9   3.76   1.76    0.9490  (high!)\n",
      "petal width:    0.1  2.5   1.20   0.76    0.9565  (high!)\n",
      "============== ==== ==== ======= ===== ====================\n",
      "\n",
      ":Missing Attribute Values: None\n",
      ":Class Distribution: 33.3% for each of 3 classes.\n",
      ":Creator: R.A. Fisher\n",
      ":Donor: Michael Marshall (MARSHALL%PLU@io.arc.nasa.gov)\n",
      ":Date: July, 1988\n",
      "\n",
      "The famous Iris database, first used by Sir R.A. Fisher. The dataset is taken\n",
      "from Fisher's paper. Note that it's the same as in R, but not as in the UCI\n",
      "Machine Learning Repository, which has two wrong data points.\n",
      "\n",
      "This is perhaps the best known database to be found in the\n",
      "pattern recognition literature.  Fisher's paper is a classic in the field and\n",
      "is referenced frequently to this day.  (See Duda & Hart, for example.)  The\n",
      "data set contains 3 classes of 50 instances each, where each class refers to a\n",
      "type of iris plant.  One class is linearly separable from the other 2; the\n",
      "latter are NOT linearly separable from each other.\n",
      "\n",
      ".. dropdown:: References\n",
      "\n",
      "  - Fisher, R.A. \"The use of multiple measurements in taxonomic problems\"\n",
      "    Annual Eugenics, 7, Part II, 179-188 (1936); also in \"Contributions to\n",
      "    Mathematical Statistics\" (John Wiley, NY, 1950).\n",
      "  - Duda, R.O., & Hart, P.E. (1973) Pattern Classification and Scene Analysis.\n",
      "    (Q327.D83) John Wiley & Sons.  ISBN 0-471-22361-1.  See page 218.\n",
      "  - Dasarathy, B.V. (1980) \"Nosing Around the Neighborhood: A New System\n",
      "    Structure and Classification Rule for Recognition in Partially Exposed\n",
      "    Environments\".  IEEE Transactions on Pattern Analysis and Machine\n",
      "    Intelligence, Vol. PAMI-2, No. 1, 67-71.\n",
      "  - Gates, G.W. (1972) \"The Reduced Nearest Neighbor Rule\".  IEEE Transactions\n",
      "    on Information Theory, May 1972, 431-433.\n",
      "  - See also: 1988 MLC Proceedings, 54-64.  Cheeseman et al\"s AUTOCLASS II\n",
      "    conceptual clustering system finds 3 classes in the data.\n",
      "  - Many, many more ...\n",
      "\n"
     ]
    }
   ],
   "source": [
    "print(iris.DESCR)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.13.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
